<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../../style.css" type="text/css" media="screen">
<link rel="stylesheet" href="../../../print.css" type="text/css" media="print">
<meta content="ArrayIterator,jp.raohmaru.collections.ArrayIterator,count,loop,position,current,first,getAt,hasNext,hasPrevious,last,next,previous,reset" name="keywords">
<title>jp.raohmaru.collections.ArrayIterator</title>
</head>
<body>
<script type="text/javascript" language="javascript" src="../../../asdoc.js"></script><script type="text/javascript" language="javascript" src="../../../cookies.js"></script><script type="text/javascript" language="javascript">
<!--
				asdocTitle = 'ArrayIterator - Raohmaru AS3 Framework';
				var baseRef = '../../../';
				window.onload = configPage;
			--></script>
<table style="display:none" id="titleTable" cellspacing="0" cellpadding="0" class="titleTable">
<tr>
<td align="left" class="titleTableTitle">Raohmaru AS3 

Framework</td><td align="right" class="titleTableTopNav"><a onclick="loadClassListFrame('../../../all-classes.html')" href="../../../package-summary.html">All&nbsp;Packages</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../all-classes.html')" href="../../../class-summary.html">All&nbsp;Classes</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../index-list.html')" href="../../../all-index-A.html">Index</a>&nbsp;|&nbsp;<a href="../../../index.html?jp/raohmaru/collections/ArrayIterator.html&amp;jp/raohmaru/collections/class-list.html" id="framesLink1">Frames</a><a onclick="parent.location=document.location" href="" style="display:none" id="noFramesLink1">No&nbsp;Frames</a></td><td rowspan="3" align="right" class="titleTableLogo"><img alt="Adobe Logo" title="Adobe Logo" class="logoImage" src="../../../images/logo.jpg"></td>
</tr>
<tr class="titleTableRow2">
<td align="left" id="subTitle" class="titleTableSubTitle">Class&nbsp;ArrayIterator</td><td align="right" id="subNav" class="titleTableSubNav"><a href="#propertySummary">Properties</a>&nbsp;| <a href="#methodSummary">Methods</a></td>
</tr>
<tr class="titleTableRow3">
<td colspan="2">&nbsp;</td>
</tr>
</table>
<script type="text/javascript" language="javascript">
<!--
if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("Class ArrayIterator"); titleBar_setSubNav(false,true,false,false,false,false,true,false,false,false,false,false,false,false);}
--></script>
<div class="MainContent">
<table cellspacing="0" cellpadding="0" class="classHeaderTable">
<tr>
<td class="classHeaderTableLabel">Package</td><td><a onclick="javascript:loadClassListFrame('class-list.html')" href="package-detail.html">jp.raohmaru.collections</a></td>
</tr>
<tr>
<td class="classHeaderTableLabel">Class</td><td class="classSignature">public class ArrayIterator</td>
</tr>
<tr>
<td class="classHeaderTableLabel">Implements</td><td><a href="Iterator.html">Iterator</a></td>
</tr>
</table>
<p></p>
 La clase ArrayIterator proporciona los métodos para recorrer los elementos de una matriz.
 <p></p>
<br>
<span class="label">Example</span>
<br><div class='listing'><pre>
import jp.raohmaru.collections.ArrayIterator;
import jp.raohmaru.collections.Iterator;

var arr :Array = [0,1,2,3,4];
var it:Iterator = new ArrayIterator(arr);

while( it.hasNext() )
{
 trace( "["+it.position+"] -> " + it.next());
}

// Salida:
//   [0] -> 0
//   [1] -> 1
//   [2] -> 2
//   [3] -> 3
//   [4] -> 4
</pre></div>
 <p></p>
<br>
<hr>
</div>
<a name="propertySummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Properties</div>
<table id="summaryTableProperty" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Property</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#count">count</a> : uint<div class="summaryTableDescription">[read-only]
  Obtiene la longitud de la matriz.</div>
</td><td class="summaryTableOwnerCol">ArrayIterator</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#loop">loop</a> : Boolean<div class="summaryTableDescription">
  
  Define si el iterador debe recorrer la colección de datos en bucle.</div>
</td><td class="summaryTableOwnerCol">ArrayIterator</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#position">position</a> : int<div class="summaryTableDescription">
  Obtiene o define la posición del índice interno que recorre la matriz.</div>
</td><td class="summaryTableOwnerCol">ArrayIterator</td>
</tr>
</table>
</div>
<a name="methodSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Methods</div>
<table id="summaryTableMethod" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#ArrayIterator()">ArrayIterator</a>(collection:Array)</div>
<div class="summaryTableDescription">
  Crea una nueva instancia de ArrayIterator.</div>
</td><td class="summaryTableOwnerCol">ArrayIterator</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#current()">current</a>():Object</div>
<div class="summaryTableDescription">
  Obtiene el elemento actual de la matriz.</div>
</td><td class="summaryTableOwnerCol">ArrayIterator</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#first()">first</a>():Object</div>
<div class="summaryTableDescription">
  
  Obtiene el primer elemento y restablece a <code>0</code> el índice interno.</div>
</td><td class="summaryTableOwnerCol">ArrayIterator</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#getAt()">getAt</a>(pos:uint):Object</div>
<div class="summaryTableDescription">
  
  Obtiene un elemento en la posición indicada.</div>
</td><td class="summaryTableOwnerCol">ArrayIterator</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#hasNext()">hasNext</a>():Boolean</div>
<div class="summaryTableDescription">
  Determina si quedan elementos en la matriz a recorrer.</div>
</td><td class="summaryTableOwnerCol">ArrayIterator</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#hasPrevious()">hasPrevious</a>():Boolean</div>
<div class="summaryTableDescription">
  Determina si quedan elementos en la matriz a recorrer en sentido ascendente.</div>
</td><td class="summaryTableOwnerCol">ArrayIterator</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#last()">last</a>():Object</div>
<div class="summaryTableDescription">
  
  Obtiene el último elemento y establece el índice interno a la última posición.</div>
</td><td class="summaryTableOwnerCol">ArrayIterator</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#next()">next</a>():Object</div>
<div class="summaryTableDescription">
  
  Obtiene el siguiente elemento y aumenta en uno el índice interno.</div>
</td><td class="summaryTableOwnerCol">ArrayIterator</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#previous()">previous</a>():Object</div>
<div class="summaryTableDescription">
  
  Obtiene el elemento anterior y disminuye en uno el índice interno.</div>
</td><td class="summaryTableOwnerCol">ArrayIterator</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#reset()">reset</a>():void</div>
<div class="summaryTableDescription">
  
  Restablece el índice interno a <code>0</code>.</div>
</td><td class="summaryTableOwnerCol">ArrayIterator</td>
</tr>
</table>
</div>
<script type="text/javascript" language="javascript">
<!--
showHideInherited();
--></script>
<div class="MainContent">
<a name="propertyDetail"></a>
<div class="detailSectionHeader">Property detail</div>
<a name="count"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">count</td><td class="detailHeaderType">property</td>
</tr>
</table>
<div class="detailBody">
<code>count:uint</code>&nbsp;&nbsp;[read-only]<p>
  Obtiene la longitud de la matriz.
  </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get count():uint</code>
<br>
<p>
<span class="label">See also</span>
</p>
<div class="seeAlso">Array.length</div>
</div>
<a name="loop"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">loop</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>loop:Boolean</code>&nbsp;&nbsp;[read-write]<p>
  
  Define si el iterador debe recorrer la colección de datos en bucle. Si se establece a <code>true</code>, vuelve a empezar si alcanza el último elemento
  (el índice interno se pone a <code>0</code>), o retorna el último elementos si se ha retrocedido hasta el prinicipio.
  </p><p>The default value is <code>false</code>.</p>
<span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get loop():Boolean</code>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set loop(value:Boolean):void</code>
<br>
</div>
<a name="position"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">position</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>position:int</code>&nbsp;&nbsp;[read-write]<p>
  Obtiene o define la posición del índice interno que recorre la matriz.
  Si la nueva posición excede de los límites de la colección, se adecuará a esos límites. Si la propiedad <code>loop</code> es <code>true</code>,
  el nuevo índice se establecerá a un valor equivalente al número de veces que sobrepasa la longitud de la colección, cómo si la recorriera en bucle.
  </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get position():int</code>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set position(value:int):void</code>
<br>
</div>
<a name="constructorDetail"></a>
<div class="detailSectionHeader">Constructor detail</div>
<a name="ArrayIterator()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">ArrayIterator</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">constructor</td>
</tr>
</table>
<div class="detailBody">
<code>public function ArrayIterator(collection:Array)</code><p>
  Crea una nueva instancia de ArrayIterator.
  </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">collection</span>:Array</code> &mdash; Una matriz que será recorrida
  </td>
</tr>
</table>
</div>
<a name="methodDetail"></a>
<div class="detailSectionHeader">Method detail</div>
<a name="current()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">current</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td>
</tr>
</table>
<div class="detailBody">
<code>public function current():Object</code><p>
  Obtiene el elemento actual de la matriz.
  </p><p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>Object</code> &mdash; El elemento actual de la matriz
  </td>
</tr>
</table>
<br>
<span class="label">Example</span>
<br> <div class='listing'><pre>
 import jp.raohmaru.collections.ArrayIterator;
 
 var arr :Array = ["a", "b", "c", "d"];
 var it:ArrayIterator = new ArrayIterator(arr);
 
 trace(it.next()); // Devuelve "a"
 trace(it.current());  // Devuelve "b", pues el índice interno ha avanzado una posición con next()
 </pre></div>
  <p></p>
</div>
<a name="first()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">first</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function first():Object</code><p>
  
  Obtiene el primer elemento y restablece a <code>0</code> el índice interno.
  </p><p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>Object</code> &mdash; El primer elemento de la colección.
  </td>
</tr>
</table>
</div>
<a name="getAt()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">getAt</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function getAt(pos:uint):Object</code><p>
  
  Obtiene un elemento en la posición indicada. Si está fuera de los límites de la colección, el valor obtenido será <code>null</code>.
  Este método no modifica el índice interno.
  </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">pos</span>:uint</code></td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>Object</code> &mdash; El elemento en la posición indicada.
  </td>
</tr>
</table>
</div>
<a name="hasNext()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">hasNext</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function hasNext():Boolean</code><p>
  Determina si quedan elementos en la matriz a recorrer.
  Si <code>loop</code> se ha establecido a <code>true</code> siempre devuelve verdadero.
  </p><p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>Boolean</code> &mdash; Un valor booleano que indica si quedan elementos en la matriz
  </td>
</tr>
</table>
</div>
<a name="hasPrevious()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">hasPrevious</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function hasPrevious():Boolean</code><p>
  Determina si quedan elementos en la matriz a recorrer en sentido ascendente.
  Si <code>loop</code> se ha establecido a <code>true</code> siempre devuelve verdadero.
  </p><p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>Boolean</code> &mdash; Un valor booleano que indica si quedan elementos anteriores al actual en la matriz.
  </td>
</tr>
</table>
</div>
<a name="last()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">last</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function last():Object</code><p>
  
  Obtiene el último elemento y establece el índice interno a la última posición.
  </p><p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>Object</code> &mdash; El último elemento de la colección.
  </td>
</tr>
</table>
</div>
<a name="next()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">next</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function next():Object</code><p>
  
  Obtiene el siguiente elemento y aumenta en uno el índice interno.
  Si <code>loop</code> es <code>true</code> y se ha alcanzado el último elemento de la colección, el índice interno se establece a 0.
  </p><p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>Object</code> &mdash; El siguiente elemento de la colección
  </td>
</tr>
</table>
</div>
<a name="previous()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">previous</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function previous():Object</code><p>
  
  Obtiene el elemento anterior y disminuye en uno el índice interno.
  Si <code>loop</code> es <code>true</code> y se ha alcanzado el primer elemento de la colección, el índice interno se establece a la última posición.
  </p><p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>Object</code> &mdash; El siguiente anterior de la colección
  </td>
</tr>
</table>
</div>
<a name="reset()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">reset</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function reset():void</code><p>
  
  Restablece el índice interno a <code>0</code>.
  </p></div>
<br>
<br>
<hr>
<br>
<p></p>
<center class="copyright">http://www.raohmaru.com</center>
</div>
</body>
</html>
<!--http://www.raohmaru.com-->
